<?php
/*
 * @Author: lokei
 * @Date: 2023-03-22 09:03:31
 * @LastEditors: lokei
 * @LastEditTime: 2023-03-22 09:06:20
 * @Description: 
 */
namespace App\Http\Controllers\Store\License;

use App\Common\Tools\ResultTool;
use App\Http\Controllers\Controller;
use App\Models\Store\StoreModel;
use Illuminate\Http\Request;

class LicenseController extends Controller {
    public function get(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('store_id'))->first();
        $res = ResultTool::success();
        $res['data']['license'] = $store->license;
        return $res;
    }

    public function set(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('store_id'))->first();
        $store->license = $request->input('license');
        $store->save();
        return ResultTool::success();
    }
}